4456048e79cde5019108db7c8406a9d8169cccc9,apps/i2ptunnel/java/src/net/i2p/i2ptunnel/HTTPResponseOutputStream.java,Pusher,run,#,233

Before Change


                ratio = compressed/expanded;

            _context.statManager().addRateData("i2ptunnel.httpCompressionRatio", (int)(100d*ratio), end-start);
            _context.statManager().addRateData("i2ptunnel.httpCompressed", (long)compressed, end-start);
            _context.statManager().addRateData("i2ptunnel.httpExpanded", (long)expanded, end-start);
        }
    }

After Change



            double compressed = (_in != null ? _in.getTotalRead() : 0);
            double expanded = (_in != null ? _in.getTotalExpanded() : 0);
            if (compressed > 0 && expanded > 0) {
                // only update the stats if we did something
                double ratio = compressed/expanded;
                _context.statManager().addRateData("i2ptunnel.httpCompressionRatio", (int)(100d*ratio), 0);
                _context.statManager().addRateData("i2ptunnel.httpCompressed", (long)compressed, 0);
                _context.statManager().addRateData("i2ptunnel.httpExpanded", (long)expanded, 0);
            }
        }